package io.lvdaxian.mybatis.session.defaults;

import io.lvdaxian.mybatis.binding.MapperRegistry;
import io.lvdaxian.mybatis.session.SqlSession;
import io.lvdaxian.mybatis.session.SqlSessionFactory;

public class DefaultSqlSessionFactory implements SqlSessionFactory {
  
  private final MapperRegistry mapperRegistry;
  
  public DefaultSqlSessionFactory(MapperRegistry mapperRegistry) {
    this.mapperRegistry = mapperRegistry;
  }
  
  @Override
  public SqlSession openSession() {
    return new DefaultSqlSession(mapperRegistry);
  }
}
